package com.tang.framework.core.controller;

import com.tang.framework.component.TokenService;
import com.tang.framework.core.domain.HttpResult;
import com.tang.framework.core.model.LoginUser;

import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

/**
 * @author tang jun liang
 * @Date 2023/2/10 13:42
 */
public class BaseController {

   @Resource
   protected HttpServletRequest httpServletRequest;

   @Resource
   protected HttpServletResponse httpServletResponse;

   @Resource
   private TokenService tokenService;




   protected LoginUser getCurrLoginUser(){
      return tokenService.getLoginUser(httpServletRequest);
   }

   protected <T> HttpResult<T> ok(T data) {
      return HttpResult.ok(data);
   }

}
